package user.mq;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import user.mq.config.RabbitMQConfig;

/**
 * Created by linving on 2017/3/23.
 */
@Service
public class Sender {
    @Autowired
    private AmqpTemplate rabbitTemplate;
    public void send() {
        System.out.println("发送消息...");
        rabbitTemplate.convertAndSend(RabbitMQConfig.QUEUE_NAME, "你好...!");
    }
}
